package model

import (
	"gorm.io/gorm"
	"time"
)

type Order struct {
	Id        uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	UserId    uint           `gorm:"column:user_id;type:bigint UNSIGNED;not null;default:0;" json:"user_id"`
	HouseId   uint           `gorm:"column:house_id;type:bigint UNSIGNED;not null;" json:"house_id"`
	Status    uint           `gorm:"column:status;type:int UNSIGNED;comment:订单状态：1：未审核 32：待审核 3：签约 4：尾款 5：过户 6：完成;not null;" json:"status"` // 订单状态：1：未审核 2：锁定中 3：待审核 4：签约 5：尾款 6：过户 7：完成
	OrderUrl  string         `gorm:"column:order_url;type:varchar(255);not null;" json:"order_url"`
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (o *Order) TableName() string {
	return "order"
}
